home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / mac / DirectX SDK / DXSDK / samples / Multimedia / VBSamples / DirectSound / EffectsBuffers / frmGargle.frm < prev    next >
Text File  |  2001-10-08  |  5KB  |  164 lines

  1. VERSION 5.00
  2. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  3. Begin VB.Form frmGargle 
  4.    BorderStyle     =   4  'Fixed ToolWindow
  5.    Caption         =   "Gargle Effects Update"
  6.    ClientHeight    =   1635
  7.    ClientLeft      =   45
  8.    ClientTop       =   285
  9.    ClientWidth     =   2775
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   1635
  14.    ScaleWidth      =   2775
  15.    ShowInTaskbar   =   0   'False
  16.    StartUpPosition =   1  'CenterOwner
  17.    Begin VB.OptionButton optTriangle 
  18.       Caption         =   "Triangle"
  19.       Height          =   255
  20.       Left            =   1680
  21.       TabIndex        =   6
  22.       Top             =   540
  23.       Width           =   915
  24.    End
  25.    Begin VB.OptionButton optSquare 
  26.       Caption         =   "Square"
  27.       Height          =   255
  28.       Left            =   120
  29.       TabIndex        =   5
  30.       Top             =   540
  31.       Width           =   915
  32.    End
  33.    Begin MSComctlLib.Slider sldRate 
  34.       Height          =   195
  35.       Left            =   780
  36.       TabIndex        =   4
  37.       Top             =   960
  38.       Width           =   1935
  39.       _ExtentX        =   3413
  40.       _ExtentY        =   344
  41.       _Version        =   393216
  42.       LargeChange     =   100
  43.       SmallChange     =   10
  44.       Min             =   1
  45.       Max             =   1000
  46.       SelStart        =   1
  47.       TickFrequency   =   100
  48.       Value           =   1
  49.    End
  50.    Begin VB.CommandButton cmdOK 
  51.       Caption         =   "OK"
  52.       Height          =   315
  53.       Left            =   1800
  54.       TabIndex        =   3
  55.       Top             =   1260
  56.       Width           =   915
  57.    End
  58.    Begin VB.Label lbl 
  59.       BackStyle       =   0  'Transparent
  60.       Caption         =   "Rate Hz"
  61.       Height          =   255
  62.       Index           =   1
  63.       Left            =   60
  64.       TabIndex        =   2
  65.       Top             =   960
  66.       Width           =   735
  67.    End
  68.    Begin VB.Label lbl 
  69.       BackStyle       =   0  'Transparent
  70.       Caption         =   "Wave Type"
  71.       Height          =   255
  72.       Index           =   0
  73.       Left            =   60
  74.       TabIndex        =   1
  75.       Top             =   300
  76.       Width           =   915
  77.    End
  78.    Begin VB.Label lbl 
  79.       BackStyle       =   0  'Transparent
  80.       Caption         =   "Here you can modify the gargle effect"
  81.       Height          =   255
  82.       Index           =   4
  83.       Left            =   60
  84.       TabIndex        =   0
  85.       Top             =   60
  86.       Width           =   2655
  87.    End
  88. End
  89. Attribute VB_Name = "frmGargle"
  90. Attribute VB_GlobalNameSpace = False
  91. Attribute VB_Creatable = False
  92. Attribute VB_PredeclaredId = True
  93. Attribute VB_Exposed = False
  94. Option Explicit
  95. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  96. '
  97. '  Copyright (C) 1999-2001 Microsoft Corporation.  All Rights Reserved.
  98. '
  99. '  File:       frmGargle.frm
  100. '
  101. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  102. Private oBuffer As DirectSoundSecondaryBuffer8
  103. Private mlIndex As Long
  104.  
  105. Private oFX As DirectSoundFXGargle8
  106.  
  107. Private Sub SaveAllSettings()
  108.     Dim fxNew As DSFXGARGLE
  109.     
  110.     'Ok, save these new settings
  111.     'Set the new information up
  112.     fxNew.lRateHz = CLng(sldRate.Value)
  113.     If optSquare.Value Then
  114.         fxNew.lWaveShape = DSFXGARGLE_WAVE_SQUARE
  115.     ElseIf optTriangle.Value Then
  116.         fxNew.lWaveShape = DSFXGARGLE_WAVE_TRIANGLE
  117.     End If
  118.     'Now update the effect
  119.     oFX.SetAllParameters fxNew
  120. End Sub
  121.  
  122. Private Sub cmdOK_Click()
  123.     SaveAllSettings
  124.     Unload Me
  125. End Sub
  126.  
  127. Private Sub Form_Load()
  128.     Dim fxCurrent As DSFXGARGLE
  129.     
  130.     'Get the gargle interface
  131.     Set oFX = oBuffer.GetObjectinPath(DSFX_STANDARD_GARGLE, mlIndex, IID_DirectSoundFXGargle)
  132.     'Get the current settings from it
  133.     fxCurrent = oFX.GetAllParameters
  134.     'Now put them out there
  135.     sldRate.Value = fxCurrent.lRateHz
  136.     If fxCurrent.lWaveShape = DSFXGARGLE_WAVE_SQUARE Then
  137.         optSquare.Value = True
  138.     ElseIf fxCurrent.lWaveShape = DSFXGARGLE_WAVE_TRIANGLE Then
  139.         optTriangle.Value = True
  140.     End If
  141. End Sub
  142.  
  143. Public Sub SetBuffer(oBuf As DirectSoundSecondaryBuffer8, Index As Long)
  144.     'Store the buffer and index
  145.     Set oBuffer = oBuf
  146.     mlIndex = Index
  147. End Sub
  148.  
  149. Private Sub optSquare_Click()
  150.     SaveAllSettings
  151. End Sub
  152.  
  153. Private Sub optTriangle_Click()
  154.     SaveAllSettings
  155. End Sub
  156.  
  157. Private Sub sldRate_Change()
  158.     SaveAllSettings
  159. End Sub
  160.  
  161. Private Sub sldRate_Scroll()
  162.     SaveAllSettings
  163. End Sub
  164.